@skrr-ai/cli 0.1.145 → 0.1.147
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-command.js +38 -21
- package/dist/commands/agenda/plan.d.ts +14 -0
- package/dist/commands/agenda/plan.js +29 -0
- package/dist/commands/agent/message/approve.js +5 -1
- package/dist/commands/agent/message/decline.js +5 -1
- package/dist/commands/agent/message/send.d.ts +11 -0
- package/dist/commands/agent/message/send.js +34 -8
- package/dist/commands/agent-worker.js +2 -1
- package/dist/commands/agents/activity.js +2 -1
- package/dist/commands/agents/always-on/enable.js +1 -1
- package/dist/commands/agents/badge.js +10 -5
- package/dist/commands/agents/categories/index.js +2 -1
- package/dist/commands/agents/chat.d.ts +1 -0
- package/dist/commands/agents/chat.js +29 -1
- package/dist/commands/agents/create.js +4 -1
- package/dist/commands/agents/overview.js +2 -1
- package/dist/commands/agents/releases/create.js +2 -1
- package/dist/commands/agents/schedule-overview.js +12 -11
- package/dist/commands/agents/schedule.js +2 -1
- package/dist/commands/agents/spawn.d.ts +38 -1
- package/dist/commands/agents/spawn.js +112 -9
- package/dist/commands/agents/tools/auth.js +2 -1
- package/dist/commands/agents/tools/calls.js +2 -1
- package/dist/commands/agents/triggers/fire.js +20 -0
- package/dist/commands/agents/visibility.js +2 -1
- package/dist/commands/balance/show.js +17 -2
- package/dist/commands/balance/statement.js +2 -1
- package/dist/commands/commands.js +2 -1
- package/dist/commands/commitments/create.js +2 -1
- package/dist/commands/commitments/delivery.js +2 -1
- package/dist/commands/commitments/doctor.js +2 -1
- package/dist/commands/commitments/observations.js +2 -2
- package/dist/commands/commitments/operating-review.js +2 -1
- package/dist/commands/commitments/pack/preflight.js +2 -1
- package/dist/commands/commitments/trigger-status.js +2 -1
- package/dist/commands/convos/messages.js +2 -1
- package/dist/commands/daemon/logs.js +18 -9
- package/dist/commands/daemon/usage.js +2 -1
- package/dist/commands/dm/messages.js +2 -1
- package/dist/commands/dm/thread/messages.js +2 -1
- package/dist/commands/dm/threads.js +2 -1
- package/dist/commands/doctor.js +2 -1
- package/dist/commands/goals/key-results/assess.js +2 -1
- package/dist/commands/goals/key-results/history.js +2 -1
- package/dist/commands/harnesses/forget.js +2 -1
- package/dist/commands/harnesses/show.js +12 -6
- package/dist/commands/inbox/index.js +4 -3
- package/dist/commands/initiatives/decide.js +2 -1
- package/dist/commands/instructions/diff.js +2 -1
- package/dist/commands/instructions/show.js +2 -1
- package/dist/commands/login.js +4 -2
- package/dist/commands/machines/dedicated/cp.js +2 -1
- package/dist/commands/machines/dedicated/power/set.js +2 -1
- package/dist/commands/machines/show.js +2 -1
- package/dist/commands/memory/maintain.js +2 -1
- package/dist/commands/memory/read.js +2 -1
- package/dist/commands/memory/rebuild-index.js +2 -1
- package/dist/commands/memory/rebuild.js +2 -1
- package/dist/commands/memory/search.js +2 -1
- package/dist/commands/messages/list.js +2 -1
- package/dist/commands/revoke-daemon.js +2 -1
- package/dist/commands/revoke-token.js +2 -1
- package/dist/commands/search/all.js +14 -7
- package/dist/commands/search/workspace.js +2 -1
- package/dist/commands/set-capabilities.js +2 -1
- package/dist/commands/skills/browse.js +8 -2
- package/dist/commands/spaces/auto-executor/preview.js +3 -2
- package/dist/commands/spaces/auto-executor/runs.js +4 -1
- package/dist/commands/spaces/workflow-templates/extract.d.ts +1 -0
- package/dist/commands/spaces/workflow-templates/extract.js +9 -1
- package/dist/commands/spaces/workflows/events.js +6 -3
- package/dist/commands/spaces/workflows/run.js +5 -3
- package/dist/commands/spaces/workflows/update.js +2 -1
- package/dist/commands/store/gallery-admissions/preview.js +2 -1
- package/dist/commands/store/publishers/profile/handle.js +2 -1
- package/dist/commands/tasks/comments/anchor.js +23 -9
- package/dist/commands/tasks/complete.js +4 -2
- package/dist/commands/tasks/create-tree.js +7 -3
- package/dist/commands/tasks/create.js +2 -1
- package/dist/commands/tasks/deliverable/add.js +2 -1
- package/dist/commands/tasks/deliverable/archive.js +2 -1
- package/dist/commands/tasks/deliverable/list.js +2 -1
- package/dist/commands/tasks/expectations/assess.js +2 -1
- package/dist/commands/tasks/labels/create.js +2 -1
- package/dist/commands/tasks/preflight.js +4 -2
- package/dist/commands/tasks/ready.js +2 -1
- package/dist/commands/tasks/result/submit.js +2 -1
- package/dist/commands/tasks/updates/add.js +2 -1
- package/dist/commands/tasks/wait.js +2 -1
- package/dist/commands/token/list.js +2 -1
- package/dist/commands/token/mint.js +2 -1
- package/dist/commands/triggers/audit.js +1 -1
- package/dist/commands/triggers/fire.js +19 -0
- package/dist/commands/wiki/write.js +14 -7
- package/dist/hooks/command-not-found.js +2 -1
- package/dist/lib/agent-chat-start.d.ts +77 -0
- package/dist/lib/agent-chat-start.js +169 -0
- package/dist/lib/agent-config.js +2 -1
- package/dist/lib/agent-endpoints.js +4 -2
- package/dist/lib/agent-evals.js +2 -1
- package/dist/lib/agent-guide-reference-gate.js +22 -11
- package/dist/lib/agent-guides.js +4 -1
- package/dist/lib/agent-instructions.js +5 -1
- package/dist/lib/agent-ref.js +8 -4
- package/dist/lib/agent-trigger-listing.js +2 -1
- package/dist/lib/agentic-stream.d.ts +21 -0
- package/dist/lib/agentic-stream.js +75 -6
- package/dist/lib/api-error-reason.js +2 -1
- package/dist/lib/api-fetch.js +5 -3
- package/dist/lib/appData.js +6 -6
- package/dist/lib/appInstallations.js +10 -5
- package/dist/lib/appsCheck.js +2 -1
- package/dist/lib/auth-failure.js +2 -1
- package/dist/lib/auth-storage.js +2 -1
- package/dist/lib/balance.js +6 -3
- package/dist/lib/capability-matrix.js +4 -2
- package/dist/lib/cli-runtime.js +2 -1
- package/dist/lib/code-handover.js +8 -3
- package/dist/lib/command-hygiene.js +28 -12
- package/dist/lib/command-manifest.js +6 -3
- package/dist/lib/commitment-attention-copy.js +2 -1
- package/dist/lib/commitment-event-wakes.js +9 -0
- package/dist/lib/commitment-product.js +5 -3
- package/dist/lib/commitment-terms.js +2 -1
- package/dist/lib/commitments.d.ts +8 -0
- package/dist/lib/commitments.js +8 -4
- package/dist/lib/compasses.js +2 -1
- package/dist/lib/completion-index.js +2 -1
- package/dist/lib/computer-files.js +8 -6
- package/dist/lib/config.js +11 -5
- package/dist/lib/conversation-search.js +4 -2
- package/dist/lib/daemon-installer.js +6 -2
- package/dist/lib/daemon-maintenance.js +2 -1
- package/dist/lib/daemon-ref.js +2 -1
- package/dist/lib/daemonBroker.js +6 -3
- package/dist/lib/daemonBrokerRefusal.js +4 -2
- package/dist/lib/daemonHandoff.js +14 -7
- package/dist/lib/daemonIslandProfile.js +2 -1
- package/dist/lib/dedicated-copy.js +9 -3
- package/dist/lib/dedicated-exec.js +2 -1
- package/dist/lib/dedicated-keep-awake.js +2 -1
- package/dist/lib/dedicated-machines.js +9 -5
- package/dist/lib/dedicated-service.js +2 -1
- package/dist/lib/dedicated-ssh.js +5 -3
- package/dist/lib/deployed-build.js +2 -1
- package/dist/lib/device-code.js +4 -3
- package/dist/lib/dpop-auth.js +2 -1
- package/dist/lib/earnings.js +2 -1
- package/dist/lib/exec-runtime-binary.js +5 -3
- package/dist/lib/first-party-harness-broker.js +4 -3
- package/dist/lib/first-party-harness-managed.js +2 -1
- package/dist/lib/first-party-harness-startup-update.js +8 -4
- package/dist/lib/first-party-harness-update.js +2 -1
- package/dist/lib/first-party-harness.js +2 -1
- package/dist/lib/format.d.ts +5 -0
- package/dist/lib/format.js +24 -4
- package/dist/lib/git-task.js +10 -5
- package/dist/lib/github-tools.js +6 -3
- package/dist/lib/harnesses.js +4 -2
- package/dist/lib/hosted-machines.js +2 -1
- package/dist/lib/html-text.js +33 -16
- package/dist/lib/instruction-blocks.js +2 -1
- package/dist/lib/iso-instant.js +5 -3
- package/dist/lib/keychain.js +15 -5
- package/dist/lib/label-scope.js +2 -1
- package/dist/lib/live-runtime-binary.js +10 -7
- package/dist/lib/local-skills.js +10 -6
- package/dist/lib/login.js +3 -2
- package/dist/lib/machine-audit.js +2 -1
- package/dist/lib/machine-daemon-log.js +2 -1
- package/dist/lib/machine-services.js +2 -1
- package/dist/lib/memory-history-session.js +2 -1
- package/dist/lib/memory-sync.js +6 -2
- package/dist/lib/message-intent.d.ts +10 -0
- package/dist/lib/node-adapter.js +4 -2
- package/dist/lib/northstars.js +4 -2
- package/dist/lib/oauthLogin.js +16 -7
- package/dist/lib/open-target.js +8 -4
- package/dist/lib/option-hint.js +2 -4
- package/dist/lib/outbox.js +2 -1
- package/dist/lib/planOutcome.d.ts +5 -3
- package/dist/lib/planOutcome.js +7 -4
- package/dist/lib/platform-update-local.js +2 -3
- package/dist/lib/proactiveApi.d.ts +38 -1
- package/dist/lib/proactiveApi.js +17 -1
- package/dist/lib/rate-limit-retry.js +2 -1
- package/dist/lib/reflection.js +2 -1
- package/dist/lib/request-field-flags.js +2 -1
- package/dist/lib/runtime-start-verification.js +2 -1
- package/dist/lib/schedule.d.ts +15 -0
- package/dist/lib/schedule.js +16 -1
- package/dist/lib/scoped-memory-command.js +7 -3
- package/dist/lib/search-display.js +11 -4
- package/dist/lib/skill-store-pagination.js +2 -1
- package/dist/lib/space-notebook.js +5 -3
- package/dist/lib/store-listing.js +2 -1
- package/dist/lib/task-agent-context-capabilities.js +2 -1
- package/dist/lib/task-asset-upload.js +7 -3
- package/dist/lib/task-closure.js +2 -1
- package/dist/lib/task-economics.js +2 -1
- package/dist/lib/task-execution.js +16 -8
- package/dist/lib/task-extras.js +4 -2
- package/dist/lib/task-operation-watch.js +2 -1
- package/dist/lib/task-preflight.js +3 -2
- package/dist/lib/task-recurrence-summary.js +4 -2
- package/dist/lib/task-runtime-headers.js +10 -5
- package/dist/lib/task-transcript.js +3 -2
- package/dist/lib/task-transfer.js +9 -5
- package/dist/lib/tasks.js +2 -1
- package/dist/lib/triggers.d.ts +144 -3
- package/dist/lib/triggers.js +280 -23
- package/dist/lib/update-check.js +12 -7
- package/dist/lib/usage-discovery.js +2 -1
- package/dist/lib/usd-micros.js +2 -1
- package/dist/lib/web-url.js +2 -1
- package/dist/lib/widgetCheck.js +15 -9
- package/dist/lib/widgetStaticScan.js +26 -14
- package/dist/lib/workflow-run-view.js +5 -3
- package/dist/lib/workflow-templates.d.ts +10 -0
- package/dist/lib/workflow-templates.js +47 -0
- package/dist/lib/write-target.js +4 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/authHelper.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +22 -12
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerUse.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelope.js +7 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/credentialEnvelopeBridge.js +6 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonConsentProof.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonPair.js +16 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopDaemonProof.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/desktopWire.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceIdentityBridge.js +11 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/deviceKey.js +7 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dpop.js +8 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarness.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/independentMachineReservation.js +8 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/kek/macos.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/liveState.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loginWithLocalhost.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/loopbackHttp.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/profileStateDir.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/recoveryCode.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/refresh.js +3 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +6 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/restartArtifact.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/spawnEnv.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/telemetryRedaction.js +7 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/authHelper.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +27 -18
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerUse.js +6 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelope.js +11 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/credentialEnvelopeBridge.js +6 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonConsentProof.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonPair.js +20 -8
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +5 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopDaemonProof.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/desktopWire.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceIdentityBridge.js +11 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/deviceKey.js +11 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dpop.js +12 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarness.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +4 -3
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +5 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/independentMachineReservation.js +10 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/kek/macos.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/liveState.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loginWithLocalhost.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/loopbackHttp.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +4 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profileStateDir.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/recoveryCode.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/refresh.js +3 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +6 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/restartArtifact.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/spawnEnv.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/telemetryRedaction.js +11 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +2 -1
- package/dist/node_modules/@skrr-ai/auth-core/package.json +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +20520 -20130
- package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/loopback-server.js +4 -2
- package/dist/node_modules/@skrr-ai/inference-broker/dist/cjs/managed-inference-broker.js +10 -6
- package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/loopback-server.js +4 -2
- package/dist/node_modules/@skrr-ai/inference-broker/dist/esm/managed-inference-broker.js +10 -6
- package/dist/node_modules/@skrr-ai/inference-broker/package.json +1 -1
- package/oclif.manifest.json +24 -2
- package/package.json +1 -1
package/dist/base-command.js
CHANGED
|
@@ -79,6 +79,21 @@ const dedicated_guest_1 = require("./lib/dedicated-guest");
|
|
|
79
79
|
const harness_context_1 = require("./lib/harness-context");
|
|
80
80
|
const task_resource_references_1 = require("./lib/task-resource-references");
|
|
81
81
|
const tasks_1 = require("./lib/tasks");
|
|
82
|
+
const RESOLVE_TASK_RESOURCE_REFERENCES_RE = /^[\da-f-]{36}$/i;
|
|
83
|
+
const RESOLVE_TASK_RESOURCE_REFERENCES_RE_2 = /^[\da-f]{24}$/i;
|
|
84
|
+
const HANDLE_API_ERROR_RE = /\s*Run `[^`]+` to sign in again\.$/;
|
|
85
|
+
const HAS_REMEDY_LINE_RE = /^\s*→/m;
|
|
86
|
+
const UNSUPPORTED_FLAG_REMEDY_FOR_MESSAGE_RE = /Nonexistent flag[s]?:?\s*(-{1,2}[\w-]+)/i;
|
|
87
|
+
const UNSUPPORTED_FLAG_REMEDY_FOR_MESSAGE_RE_2 = /^-+/;
|
|
88
|
+
const MISSING_FLAG_REMEDY_FOR_MESSAGE_RE = /Missing required flag[s]?:?\s*(?:\n\s*)?-{0,2}([a-z][\w-]*)/i;
|
|
89
|
+
const RETIRED_FLAG_HINT_RE = /nonexistent flag/i;
|
|
90
|
+
const RETIRED_FLAG_HINT_RE_2 = /(?:^|[\s,:])(--[a-z][\w-]*)[ =]([^\s,][^,\n]*)/i;
|
|
91
|
+
const RETIRED_FLAG_HINT_RE_3 = /^--/;
|
|
92
|
+
const PARSE_ERROR_REMEDY_RE = /:/g;
|
|
93
|
+
const PARSE_ERROR_REMEDY_RE_2 = /\s+/g;
|
|
94
|
+
const PARSE_ERROR_REMEDY_RE_3 = /Nonexistent flag[s]?:?\s*(-{1,2}[\w-]+)(?:[ =]([^\s,][^,\n]*))?/i;
|
|
95
|
+
const PARSE_ERROR_REMEDY_RE_4 = /Missing \d+ required arg/i;
|
|
96
|
+
const PARSE_CLI_ERROR_CODE_RE = /([a-z0-9])([A-Z])/g;
|
|
82
97
|
function assigneePayloadNeedsResolution(payload) {
|
|
83
98
|
const fields = [
|
|
84
99
|
['assigneeUserIds', 'user'],
|
|
@@ -721,8 +736,8 @@ class BaseCommand extends core_1.Command {
|
|
|
721
736
|
const value = payload[field];
|
|
722
737
|
return (typeof value === 'string' &&
|
|
723
738
|
value.trim() &&
|
|
724
|
-
|
|
725
|
-
|
|
739
|
+
!RESOLVE_TASK_RESOURCE_REFERENCES_RE.test(value) &&
|
|
740
|
+
!RESOLVE_TASK_RESOURCE_REFERENCES_RE_2.test(value));
|
|
726
741
|
});
|
|
727
742
|
try {
|
|
728
743
|
if (needsScope && !payload.spaceId && !existingTask && options.taskId) {
|
|
@@ -1730,7 +1745,7 @@ class BaseCommand extends core_1.Command {
|
|
|
1730
1745
|
? null
|
|
1731
1746
|
: (0, daemonBrokerRefusal_1.describeBrokerFailure)(e.brokerFailure, this.config.bin);
|
|
1732
1747
|
const renewal = refreshRefusal
|
|
1733
|
-
? refreshRefusal.message.replace(
|
|
1748
|
+
? refreshRefusal.message.replace(HANDLE_API_ERROR_RE, '')
|
|
1734
1749
|
: "This CLI's own sign-in could not be renewed.";
|
|
1735
1750
|
const authDiagnostic = this.authResolution();
|
|
1736
1751
|
const details = {
|
|
@@ -2106,7 +2121,7 @@ class BaseCommand extends core_1.Command {
|
|
|
2106
2121
|
? (0, daemonBrokerRefusal_1.describeBrokerFailure)(e.brokerFailure, this.config.bin)
|
|
2107
2122
|
: null;
|
|
2108
2123
|
const why = (refusal
|
|
2109
|
-
? refusal.message.replace(
|
|
2124
|
+
? refusal.message.replace(HANDLE_API_ERROR_RE, '')
|
|
2110
2125
|
: 'The server did not accept this sign-in.') +
|
|
2111
2126
|
// OSK-12474 — the daemon was asked for a hand-off and refused; say why.
|
|
2112
2127
|
(brokerRefusal ? ` ${brokerRefusal.headline}` : '');
|
|
@@ -2793,7 +2808,7 @@ function isRetryableFailure(status, body) {
|
|
|
2793
2808
|
}
|
|
2794
2809
|
/** True when a message already carries this CLI's `→` remedy line. */
|
|
2795
2810
|
function hasRemedyLine(message) {
|
|
2796
|
-
return
|
|
2811
|
+
return HAS_REMEDY_LINE_RE.test(message);
|
|
2797
2812
|
}
|
|
2798
2813
|
/** The remedy a call site wrote into `details.suggestion`, if it wrote one. */
|
|
2799
2814
|
function authoredSuggestion(details) {
|
|
@@ -2968,11 +2983,13 @@ function missingFlagRemedy(commandId, flag) {
|
|
|
2968
2983
|
return commandId ? exports.MISSING_FLAG_REMEDIES[commandId]?.[flag] : undefined;
|
|
2969
2984
|
}
|
|
2970
2985
|
function unsupportedFlagRemedyForMessage(message, commandId) {
|
|
2971
|
-
const match =
|
|
2972
|
-
return match
|
|
2986
|
+
const match = UNSUPPORTED_FLAG_REMEDY_FOR_MESSAGE_RE.exec(message);
|
|
2987
|
+
return match
|
|
2988
|
+
? unsupportedFlagRemedy(commandId, match[1].replace(UNSUPPORTED_FLAG_REMEDY_FOR_MESSAGE_RE_2, ''))
|
|
2989
|
+
: undefined;
|
|
2973
2990
|
}
|
|
2974
2991
|
function missingFlagRemedyForMessage(message, commandId) {
|
|
2975
|
-
const match =
|
|
2992
|
+
const match = MISSING_FLAG_REMEDY_FOR_MESSAGE_RE.exec(message);
|
|
2976
2993
|
return match ? missingFlagRemedy(commandId, match[1]) : undefined;
|
|
2977
2994
|
}
|
|
2978
2995
|
/**
|
|
@@ -2982,18 +2999,18 @@ function missingFlagRemedyForMessage(message, commandId) {
|
|
|
2982
2999
|
* which oclif reports only as an unknown flag.
|
|
2983
3000
|
*/
|
|
2984
3001
|
function retiredFlagHint(message, commandId, definedFlags = []) {
|
|
2985
|
-
if (
|
|
3002
|
+
if (!RETIRED_FLAG_HINT_RE.test(message))
|
|
2986
3003
|
return null;
|
|
2987
3004
|
const lines = [];
|
|
2988
|
-
const quoted =
|
|
3005
|
+
const quoted = RETIRED_FLAG_HINT_RE_2.exec(message.slice(message.search(RETIRED_FLAG_HINT_RE)));
|
|
2989
3006
|
const quotedFlag = quoted?.[1];
|
|
2990
|
-
if (quotedFlag && definedFlags.includes(quotedFlag.replace(
|
|
3007
|
+
if (quotedFlag && definedFlags.includes(quotedFlag.replace(RETIRED_FLAG_HINT_RE_3, ''))) {
|
|
2991
3008
|
lines.push(` "${quoted[0].trim()}" reached the command as ONE argument, so it was read as a flag named ` +
|
|
2992
3009
|
`"${quoted[0].trim()}". Pass the flag and its value separately: ${quotedFlag} ${quoted[2].trim()}`);
|
|
2993
3010
|
}
|
|
2994
3011
|
if (commandId && RETIRED_FLAG_COMMANDS.has(commandId)) {
|
|
2995
3012
|
for (const flag of Object.keys(RETIRED_FLAG_REPLACEMENTS)) {
|
|
2996
|
-
if (definedFlags.includes(flag.replace(
|
|
3013
|
+
if (definedFlags.includes(flag.replace(RETIRED_FLAG_HINT_RE_3, '')))
|
|
2997
3014
|
continue;
|
|
2998
3015
|
if (new RegExp(`${flag}(?![\\w-])`).test(message)) {
|
|
2999
3016
|
lines.push(` ${RETIRED_FLAG_REPLACEMENTS[flag]}`);
|
|
@@ -3011,12 +3028,12 @@ function retiredFlagHint(message, commandId, definedFlags = []) {
|
|
|
3011
3028
|
function parseErrorRemedy(err, commandId, bin = 'skrr') {
|
|
3012
3029
|
if (err.code)
|
|
3013
3030
|
return {};
|
|
3014
|
-
const helpCommand = `${bin} ${(commandId ?? '').replace(
|
|
3031
|
+
const helpCommand = `${bin} ${(commandId ?? '').replace(PARSE_ERROR_REMEDY_RE, ' ')} --help`.replace(PARSE_ERROR_REMEDY_RE_2, ' ');
|
|
3015
3032
|
const message = err.message || '';
|
|
3016
3033
|
const suggestion = Array.isArray(err.suggestions)
|
|
3017
3034
|
? err.suggestions.find((s) => typeof s === 'string')
|
|
3018
3035
|
: undefined;
|
|
3019
|
-
const missingFlag =
|
|
3036
|
+
const missingFlag = MISSING_FLAG_REMEDY_FOR_MESSAGE_RE.exec(message);
|
|
3020
3037
|
if (missingFlag) {
|
|
3021
3038
|
const flag = missingFlag[1];
|
|
3022
3039
|
const missingFlagHint = missingFlagRemedy(commandId, flag);
|
|
@@ -3027,13 +3044,13 @@ function parseErrorRemedy(err, commandId, bin = 'skrr') {
|
|
|
3027
3044
|
`Pass --${flag} <value>. Run \`${helpCommand}\` for its description and accepted values.`,
|
|
3028
3045
|
};
|
|
3029
3046
|
}
|
|
3030
|
-
const nonexistent =
|
|
3047
|
+
const nonexistent = PARSE_ERROR_REMEDY_RE_3.exec(message);
|
|
3031
3048
|
const unsupportedFlagHint = nonexistent
|
|
3032
|
-
? unsupportedFlagRemedy(commandId, nonexistent[1].replace(
|
|
3049
|
+
? unsupportedFlagRemedy(commandId, nonexistent[1].replace(UNSUPPORTED_FLAG_REMEDY_FOR_MESSAGE_RE_2, ''))
|
|
3033
3050
|
: undefined;
|
|
3034
3051
|
if (unsupportedFlagHint) {
|
|
3035
3052
|
return {
|
|
3036
|
-
flag: nonexistent[1].replace(
|
|
3053
|
+
flag: nonexistent[1].replace(UNSUPPORTED_FLAG_REMEDY_FOR_MESSAGE_RE_2, ''),
|
|
3037
3054
|
fix: unsupportedFlagHint.fix,
|
|
3038
3055
|
};
|
|
3039
3056
|
}
|
|
@@ -3041,19 +3058,19 @@ function parseErrorRemedy(err, commandId, bin = 'skrr') {
|
|
|
3041
3058
|
// `"--outcome failed"` arrived as ONE argument: the flag may well exist, so
|
|
3042
3059
|
// "remove it" would be wrong advice. Same case retiredFlagHint explains in text.
|
|
3043
3060
|
return {
|
|
3044
|
-
flag: nonexistent[1].replace(
|
|
3061
|
+
flag: nonexistent[1].replace(UNSUPPORTED_FLAG_REMEDY_FOR_MESSAGE_RE_2, ''),
|
|
3045
3062
|
fix: suggestion ??
|
|
3046
3063
|
`Pass the flag and its value as separate arguments: ${nonexistent[1]} ${nonexistent[2].trim()}`,
|
|
3047
3064
|
};
|
|
3048
3065
|
}
|
|
3049
3066
|
if (nonexistent) {
|
|
3050
3067
|
return {
|
|
3051
|
-
flag: nonexistent[1].replace(
|
|
3068
|
+
flag: nonexistent[1].replace(UNSUPPORTED_FLAG_REMEDY_FOR_MESSAGE_RE_2, ''),
|
|
3052
3069
|
fix: suggestion ??
|
|
3053
3070
|
`Remove ${nonexistent[1]}, or run \`${helpCommand}\` for the flags this command takes.`,
|
|
3054
3071
|
};
|
|
3055
3072
|
}
|
|
3056
|
-
if (
|
|
3073
|
+
if (PARSE_ERROR_REMEDY_RE_4.test(message)) {
|
|
3057
3074
|
return {
|
|
3058
3075
|
fix: suggestion ?? `Supply the missing argument. Run \`${helpCommand}\` for the usage line.`,
|
|
3059
3076
|
};
|
|
@@ -3062,7 +3079,7 @@ function parseErrorRemedy(err, commandId, bin = 'skrr') {
|
|
|
3062
3079
|
}
|
|
3063
3080
|
function parseCliErrorCode(err) {
|
|
3064
3081
|
if (err.name && err.name !== 'Error') {
|
|
3065
|
-
return err.name.replace(
|
|
3082
|
+
return err.name.replace(PARSE_CLI_ERROR_CODE_RE, '$1_$2').toUpperCase();
|
|
3066
3083
|
}
|
|
3067
3084
|
return 'CLI_PARSE_ERROR';
|
|
3068
3085
|
}
|
|
@@ -6,6 +6,20 @@ import { BaseCommand } from '../../base-command';
|
|
|
6
6
|
* (OSK-22554). Names the cloud worker when that is where the turn is queued.
|
|
7
7
|
*/
|
|
8
8
|
export declare function describeQueuedProgress(runtime: unknown): string;
|
|
9
|
+
/**
|
|
10
|
+
* Why a followed Agenda turn failed, in words.
|
|
11
|
+
*
|
|
12
|
+
* The stream's terminal event does not always carry the reason: a turn the platform refused (a
|
|
13
|
+
* workspace out of credit) or that lost a write wrote it on the response message only, and the
|
|
14
|
+
* command exited 1 with nothing printed (OSK-22639). The terminal event's own sentence wins; the
|
|
15
|
+
* stored message is the second witness; a failure with neither says so rather than staying silent.
|
|
16
|
+
*/
|
|
17
|
+
export declare function describeAgendaFailure(input: {
|
|
18
|
+
lastEvent: Record<string, unknown> | null | undefined;
|
|
19
|
+
readMessages: () => Promise<Array<Record<string, unknown>>>;
|
|
20
|
+
responseMessageId?: string;
|
|
21
|
+
conversationId: string;
|
|
22
|
+
}): Promise<string>;
|
|
9
23
|
/**
|
|
10
24
|
* `skrr agenda plan <agent-id>` — kick off a one-shot Agenda Planning turn
|
|
11
25
|
* for an agent. The server-side controller resolves the agent's persistent
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.describeQueuedProgress = describeQueuedProgress;
|
|
4
|
+
exports.describeAgendaFailure = describeAgendaFailure;
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
7
|
const base_command_1 = require("../../base-command");
|
|
@@ -22,6 +23,28 @@ function describeQueuedProgress(runtime) {
|
|
|
22
23
|
? 'Queued on the cloud worker, starting…'
|
|
23
24
|
: 'Queued, waiting for the agent runtime to start…';
|
|
24
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Why a followed Agenda turn failed, in words.
|
|
28
|
+
*
|
|
29
|
+
* The stream's terminal event does not always carry the reason: a turn the platform refused (a
|
|
30
|
+
* workspace out of credit) or that lost a write wrote it on the response message only, and the
|
|
31
|
+
* command exited 1 with nothing printed (OSK-22639). The terminal event's own sentence wins; the
|
|
32
|
+
* stored message is the second witness; a failure with neither says so rather than staying silent.
|
|
33
|
+
*/
|
|
34
|
+
async function describeAgendaFailure(input) {
|
|
35
|
+
let reason = (0, agentic_stream_1.terminalFailureMessage)(input.lastEvent);
|
|
36
|
+
if (!reason) {
|
|
37
|
+
try {
|
|
38
|
+
const recorded = (0, chat_1.reconcileTerminalFromMessages)(await input.readMessages(), input.responseMessageId);
|
|
39
|
+
if (recorded?.status === 'failed' && recorded.error)
|
|
40
|
+
reason = recorded.error;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// The record could not be read; the line below still says the turn failed.
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return `Agenda planning failed: ${reason ?? 'the run ended in failure and recorded no reason.'} Conversation ${input.conversationId}.`;
|
|
47
|
+
}
|
|
25
48
|
function describeRuntime(runtime) {
|
|
26
49
|
if (typeof runtime === 'string')
|
|
27
50
|
return runtime;
|
|
@@ -172,6 +195,12 @@ class AgendaPlan extends base_command_1.BaseCommand {
|
|
|
172
195
|
process.exitCode = interruptedBy === 'SIGTERM' ? 143 : interruptedBy === 'SIGHUP' ? 129 : interruptedBy ? 130 : 75;
|
|
173
196
|
}
|
|
174
197
|
else if (result.status === 'failed') {
|
|
198
|
+
process.stderr.write(`\n${await describeAgendaFailure({
|
|
199
|
+
lastEvent: result.lastEvent,
|
|
200
|
+
readMessages,
|
|
201
|
+
responseMessageId: response.responseMessageId,
|
|
202
|
+
conversationId: response.conversationId,
|
|
203
|
+
})}\n`);
|
|
175
204
|
process.exitCode = 1;
|
|
176
205
|
}
|
|
177
206
|
else if (result.status === 'aborted' && interruptedBy !== 'SIGHUP') {
|
|
@@ -16,7 +16,11 @@ class AgentMessageApprove extends base_command_1.BaseCommand {
|
|
|
16
16
|
'<%= config.bin %> agent message approve <intent-id> --agent <agent-id>',
|
|
17
17
|
];
|
|
18
18
|
static args = {
|
|
19
|
-
intent: core_1.Args.string({
|
|
19
|
+
intent: core_1.Args.string({
|
|
20
|
+
description: 'Intent ID from `agent message pending`',
|
|
21
|
+
required: true,
|
|
22
|
+
ignoreStdin: true,
|
|
23
|
+
}),
|
|
20
24
|
};
|
|
21
25
|
static flags = {
|
|
22
26
|
agent: core_1.Flags.string({ description: 'Agent ID', required: false }),
|
|
@@ -16,7 +16,11 @@ class AgentMessageDecline extends base_command_1.BaseCommand {
|
|
|
16
16
|
'<%= config.bin %> agent message decline <intent-id> --agent <agent-id>',
|
|
17
17
|
];
|
|
18
18
|
static args = {
|
|
19
|
-
intent: core_1.Args.string({
|
|
19
|
+
intent: core_1.Args.string({
|
|
20
|
+
description: 'Intent ID from `agent message pending`',
|
|
21
|
+
required: true,
|
|
22
|
+
ignoreStdin: true,
|
|
23
|
+
}),
|
|
20
24
|
};
|
|
21
25
|
static flags = {
|
|
22
26
|
agent: core_1.Flags.string({ description: 'Agent ID', required: false }),
|
|
@@ -245,8 +245,19 @@ export declare function buildEnvelope(input: {
|
|
|
245
245
|
embeds?: EntityEmbed[];
|
|
246
246
|
embedRejections?: WireEmbedRejection[];
|
|
247
247
|
presentation?: CommunicationPresentation;
|
|
248
|
+
/** What the server applied to `presentation`; shown instead of the request when it differs. */
|
|
249
|
+
appliedPresentation?: Pick<CommunicationPresentation, 'kind' | 'attention' | 'attentionRequested'>;
|
|
248
250
|
notificationPolicy?: 'normal' | 'silent';
|
|
249
251
|
intent: CanonicalIntentEnvelope['intent'];
|
|
250
252
|
}): CanonicalIntentEnvelope;
|
|
253
|
+
/**
|
|
254
|
+
* The sender's declared presentation, with the attention the server actually applied.
|
|
255
|
+
*
|
|
256
|
+
* The envelope used to echo the request, so a status declared `interrupt` and stored as `notify`
|
|
257
|
+
* still printed `interrupt` and the sender never learned its priority was lowered (OSK-22368).
|
|
258
|
+
* The requested value stays next to the applied one, only when they differ. An older server
|
|
259
|
+
* returns no presentation and the request is shown unchanged.
|
|
260
|
+
*/
|
|
261
|
+
export declare function withAppliedAttention(declared: CommunicationPresentation, applied?: Pick<CommunicationPresentation, 'kind' | 'attention' | 'attentionRequested'>): CommunicationPresentation;
|
|
251
262
|
export declare function formatEnvelope(envelope: CanonicalIntentEnvelope): string;
|
|
252
263
|
export {};
|
|
@@ -44,6 +44,7 @@ exports.rejectPrincipalOverrides = rejectPrincipalOverrides;
|
|
|
44
44
|
exports.normalizeIntentPayload = normalizeIntentPayload;
|
|
45
45
|
exports.generateIdempotencyKey = generateIdempotencyKey;
|
|
46
46
|
exports.buildEnvelope = buildEnvelope;
|
|
47
|
+
exports.withAppliedAttention = withAppliedAttention;
|
|
47
48
|
exports.formatEnvelope = formatEnvelope;
|
|
48
49
|
const crypto = __importStar(require("node:crypto"));
|
|
49
50
|
const core_1 = require("@oclif/core");
|
|
@@ -54,6 +55,10 @@ const cli_runtime_1 = require("../../../lib/cli-runtime");
|
|
|
54
55
|
const message_intent_1 = require("../../../lib/message-intent");
|
|
55
56
|
const entity_embeds_1 = require("../../../lib/entity-embeds");
|
|
56
57
|
const prompt_1 = require("../../../lib/prompt");
|
|
58
|
+
const BUILD_DESTINATION_RE = /^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/;
|
|
59
|
+
// eslint-disable-next-line no-control-regex -- Reject control characters in mail headers.
|
|
60
|
+
const BUILD_DESTINATION_RE_2 = /[\r\n\x00-\x1f\x7f]/;
|
|
61
|
+
const COMPACT_KEY_PART_RE = /[^A-Za-z0-9_.:-]/g;
|
|
57
62
|
const MAX_TEXT_CHARS = 20000;
|
|
58
63
|
const MAX_IDEMPOTENCY_KEY_CHARS = 240;
|
|
59
64
|
const MAX_SEQUENCE_PARTS = data_provider_1.MAX_AGENT_MESSAGE_SEQUENCE_PARTS;
|
|
@@ -462,6 +467,7 @@ class AgentMessageSend extends base_command_1.BaseCommand {
|
|
|
462
467
|
idempotencyKey: request.idempotencyKey,
|
|
463
468
|
threadRootMessageId: request.threadRootMessageId,
|
|
464
469
|
presentation: request.presentation,
|
|
470
|
+
appliedPresentation: result.presentation,
|
|
465
471
|
notificationPolicy: request.notificationPolicy,
|
|
466
472
|
embeds: request.embeds,
|
|
467
473
|
embedRejections: result.embedRejections,
|
|
@@ -916,9 +922,7 @@ function buildDestination({ kind, bodyDestination, overlayChannel, overlayThread
|
|
|
916
922
|
throw invalidIntent('agent_email requires 1 to 5 recipients.');
|
|
917
923
|
}
|
|
918
924
|
const recipients = rawRecipients.map((value) => {
|
|
919
|
-
if (typeof value !== 'string' ||
|
|
920
|
-
value.length > 254 ||
|
|
921
|
-
!/^[^\s@<>]+@[^\s@<>]+\.[^\s@<>]+$/.test(value))
|
|
925
|
+
if (typeof value !== 'string' || value.length > 254 || !BUILD_DESTINATION_RE.test(value))
|
|
922
926
|
throw invalidIntent('Invalid email recipient.');
|
|
923
927
|
return value.toLowerCase();
|
|
924
928
|
});
|
|
@@ -928,8 +932,7 @@ function buildDestination({ kind, bodyDestination, overlayChannel, overlayThread
|
|
|
928
932
|
if (typeof subject !== 'string' ||
|
|
929
933
|
!subject.trim() ||
|
|
930
934
|
subject.length > 200 ||
|
|
931
|
-
|
|
932
|
-
/[\r\n\x00-\x1f\x7f]/.test(subject))
|
|
935
|
+
BUILD_DESTINATION_RE_2.test(subject))
|
|
933
936
|
throw invalidIntent('Email subject must be a single line of at most 200 characters.');
|
|
934
937
|
return { kind, recipients: recipients.sort(), subject: subject.trim() };
|
|
935
938
|
}
|
|
@@ -1154,7 +1157,7 @@ function generateIdempotencyKey(agentId, payload) {
|
|
|
1154
1157
|
return `cli:${crypto.randomUUID()}:agent-message:${digest}`;
|
|
1155
1158
|
}
|
|
1156
1159
|
function compactKeyPart(value) {
|
|
1157
|
-
const cleaned = value.replace(
|
|
1160
|
+
const cleaned = value.replace(COMPACT_KEY_PART_RE, '_');
|
|
1158
1161
|
if (cleaned.length <= 80)
|
|
1159
1162
|
return cleaned;
|
|
1160
1163
|
const digest = crypto.createHash('sha256').update(value).digest('hex').slice(0, 16);
|
|
@@ -1170,6 +1173,9 @@ function statusFromLegacyDm(result) {
|
|
|
1170
1173
|
return 'delivered';
|
|
1171
1174
|
}
|
|
1172
1175
|
function buildEnvelope(input) {
|
|
1176
|
+
const presentation = input.presentation
|
|
1177
|
+
? withAppliedAttention(input.presentation, input.appliedPresentation)
|
|
1178
|
+
: undefined;
|
|
1173
1179
|
return {
|
|
1174
1180
|
ok: input.ok,
|
|
1175
1181
|
protocolVersion: PROTOCOL_VERSION,
|
|
@@ -1183,7 +1189,7 @@ function buildEnvelope(input) {
|
|
|
1183
1189
|
content: input.content,
|
|
1184
1190
|
idempotencyKey: input.idempotencyKey,
|
|
1185
1191
|
...(input.threadRootMessageId ? { threadRootMessageId: input.threadRootMessageId } : {}),
|
|
1186
|
-
...(
|
|
1192
|
+
...(presentation ? { presentation } : {}),
|
|
1187
1193
|
...(input.notificationPolicy ? { notificationPolicy: input.notificationPolicy } : {}),
|
|
1188
1194
|
...(input.embeds && input.embeds.length > 0 ? { embeds: input.embeds } : {}),
|
|
1189
1195
|
...(input.embedRejections && input.embedRejections.length > 0
|
|
@@ -1192,12 +1198,32 @@ function buildEnvelope(input) {
|
|
|
1192
1198
|
intent: input.intent,
|
|
1193
1199
|
};
|
|
1194
1200
|
}
|
|
1201
|
+
/**
|
|
1202
|
+
* The sender's declared presentation, with the attention the server actually applied.
|
|
1203
|
+
*
|
|
1204
|
+
* The envelope used to echo the request, so a status declared `interrupt` and stored as `notify`
|
|
1205
|
+
* still printed `interrupt` and the sender never learned its priority was lowered (OSK-22368).
|
|
1206
|
+
* The requested value stays next to the applied one, only when they differ. An older server
|
|
1207
|
+
* returns no presentation and the request is shown unchanged.
|
|
1208
|
+
*/
|
|
1209
|
+
function withAppliedAttention(declared, applied) {
|
|
1210
|
+
if (!applied?.attention)
|
|
1211
|
+
return declared;
|
|
1212
|
+
const requested = applied.attentionRequested ?? declared.attention;
|
|
1213
|
+
return {
|
|
1214
|
+
...declared,
|
|
1215
|
+
attention: applied.attention,
|
|
1216
|
+
...(requested && requested !== applied.attention ? { attentionRequested: requested } : {}),
|
|
1217
|
+
};
|
|
1218
|
+
}
|
|
1195
1219
|
function formatEnvelope(envelope) {
|
|
1196
1220
|
const status = envelope.intent.status;
|
|
1197
1221
|
const suffix = envelope.intent.reason ? ` (${envelope.intent.reason})` : '';
|
|
1198
1222
|
const destination = describeDestination(envelope.destination);
|
|
1199
1223
|
const presentation = envelope.presentation
|
|
1200
|
-
? ` [kind=${envelope.presentation.kind}${envelope.presentation.attention ? `, attention=${envelope.presentation.attention}` : ''}${envelope.
|
|
1224
|
+
? ` [kind=${envelope.presentation.kind}${envelope.presentation.attention ? `, attention=${envelope.presentation.attention}` : ''}${envelope.presentation.attentionRequested
|
|
1225
|
+
? ` (requested ${envelope.presentation.attentionRequested})`
|
|
1226
|
+
: ''}${envelope.destination.kind === 'app_owner_dm'
|
|
1201
1227
|
? '; reach=user-controlled; presentation=user-controlled'
|
|
1202
1228
|
: ''}]`
|
|
1203
1229
|
: '';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const guest_service_1 = require("../lib/guest-service");
|
|
5
|
+
const BINDING_REFUSED_RE = /revoked|invalid_handle|forbidden/i;
|
|
5
6
|
/**
|
|
6
7
|
* `skrr agent-worker` — the long-lived guest agent worker (§10.2).
|
|
7
8
|
*
|
|
@@ -134,7 +135,7 @@ class AgentWorker extends core_1.Command {
|
|
|
134
135
|
/** `revoked`/`invalid_handle` — the binding is gone, not the transport. */
|
|
135
136
|
bindingRefused(error) {
|
|
136
137
|
const message = error instanceof Error ? error.message : String(error);
|
|
137
|
-
return
|
|
138
|
+
return BINDING_REFUSED_RE.test(message);
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
exports.default = AgentWorker;
|
|
@@ -6,6 +6,7 @@ const base_command_1 = require("../../base-command");
|
|
|
6
6
|
const agent_resolver_1 = require("../../lib/agent-resolver");
|
|
7
7
|
const format_1 = require("../../lib/format");
|
|
8
8
|
const agent_scope_1 = require("../../lib/agent-scope");
|
|
9
|
+
const RUN_RE = /\s+/g;
|
|
9
10
|
/**
|
|
10
11
|
* "What has this agent been doing lately?" in one call.
|
|
11
12
|
*
|
|
@@ -103,7 +104,7 @@ class AgentsActivity extends base_command_1.BaseCommand {
|
|
|
103
104
|
at: dmRow.lastMessageAt ? String(dmRow.lastMessageAt) : null,
|
|
104
105
|
id: String(dmRow.conversationId ?? '-'),
|
|
105
106
|
title: 'Agent DM',
|
|
106
|
-
detail: String(dmRow.lastMessagePreview ?? (dmRow.lastMessageAt ? '' : 'no messages yet')).replace(
|
|
107
|
+
detail: String(dmRow.lastMessagePreview ?? (dmRow.lastMessageAt ? '' : 'no messages yet')).replace(RUN_RE, ' '),
|
|
107
108
|
});
|
|
108
109
|
}
|
|
109
110
|
const rawConvoItems = Array.isArray(conversations)
|
|
@@ -66,7 +66,7 @@ class AgentsAlwaysOnEnable extends base_command_1.BaseCommand {
|
|
|
66
66
|
if (!result.matched)
|
|
67
67
|
this.exit(1);
|
|
68
68
|
if (status.operationalState === 'needs_setup') {
|
|
69
|
-
this.log('Note: no Commitment or managed producer lane exists yet. Create a Commitment (or convert a
|
|
69
|
+
this.log('Note: no Commitment or managed producer lane exists yet. Create a Commitment (or convert a standalone check-in) so the runtime has something to fire.');
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -6,17 +6,22 @@ const data_provider_1 = require("@skrr-ai/data-provider");
|
|
|
6
6
|
const base_command_1 = require("../../base-command");
|
|
7
7
|
const agent_ref_1 = require("../../lib/agent-ref");
|
|
8
8
|
const agent_distribution_1 = require("../../lib/agent-distribution");
|
|
9
|
+
const ESCAPE_HTML_RE = /&/g;
|
|
10
|
+
const ESCAPE_HTML_RE_2 = /</g;
|
|
11
|
+
const ESCAPE_HTML_RE_3 = />/g;
|
|
12
|
+
const ESCAPE_HTML_RE_4 = /"/g;
|
|
13
|
+
const ESCAPE_MARKDOWN_TEXT_RE = /[\\[\]]/g;
|
|
9
14
|
const FORMATS = ['markdown', 'html', 'rst'];
|
|
10
15
|
function escapeHtml(value) {
|
|
11
16
|
return value
|
|
12
|
-
.replace(
|
|
13
|
-
.replace(
|
|
14
|
-
.replace(
|
|
15
|
-
.replace(
|
|
17
|
+
.replace(ESCAPE_HTML_RE, '&')
|
|
18
|
+
.replace(ESCAPE_HTML_RE_2, '<')
|
|
19
|
+
.replace(ESCAPE_HTML_RE_3, '>')
|
|
20
|
+
.replace(ESCAPE_HTML_RE_4, '"');
|
|
16
21
|
}
|
|
17
22
|
/** Markdown link text: brackets and backslashes would end or bend the link. */
|
|
18
23
|
function escapeMarkdownText(value) {
|
|
19
|
-
return value.replace(
|
|
24
|
+
return value.replace(ESCAPE_MARKDOWN_TEXT_RE, (char) => `\\${char}`);
|
|
20
25
|
}
|
|
21
26
|
/**
|
|
22
27
|
* The README snippet: the badge, linked to the attributed listing, then the
|
|
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
|
|
|
6
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
7
7
|
const base_command_1 = require("../../../base-command");
|
|
8
8
|
const format_1 = require("../../../lib/format");
|
|
9
|
+
const CATEGORY_DISPLAY_LABEL_RE = /[-_\s]+/;
|
|
9
10
|
/**
|
|
10
11
|
* Global default categories are seeded with LOCALIZATION KEYS as their label and
|
|
11
12
|
* description (`com_agents_category_general`), because the web translates them.
|
|
@@ -28,7 +29,7 @@ function categoryDisplayLabel(row) {
|
|
|
28
29
|
if (!value)
|
|
29
30
|
return label || '-';
|
|
30
31
|
return value
|
|
31
|
-
.split(
|
|
32
|
+
.split(CATEGORY_DISPLAY_LABEL_RE)
|
|
32
33
|
.filter(Boolean)
|
|
33
34
|
.map((word) => word[0].toUpperCase() + word.slice(1))
|
|
34
35
|
.join(' ');
|
|
@@ -279,6 +279,7 @@ export default class AgentsChat extends BaseCommand {
|
|
|
279
279
|
incremental: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
280
280
|
jsonl: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
281
281
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
282
|
+
'idempotency-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
282
283
|
'repair-wait': import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
283
284
|
'approve-tools': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
284
285
|
'permission-mode': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
@@ -23,6 +23,7 @@ const core_1 = require("@oclif/core");
|
|
|
23
23
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
24
24
|
const base_command_1 = require("../../base-command");
|
|
25
25
|
const api_fetch_1 = require("../../lib/api-fetch");
|
|
26
|
+
const agent_chat_start_1 = require("../../lib/agent-chat-start");
|
|
26
27
|
const agent_home_workspace_1 = require("../../lib/agent-home-workspace");
|
|
27
28
|
const agentic_stream_1 = require("../../lib/agentic-stream");
|
|
28
29
|
const web_url_1 = require("../../lib/web-url");
|
|
@@ -506,6 +507,13 @@ class AgentsChat extends base_command_1.BaseCommand {
|
|
|
506
507
|
json: core_1.Flags.boolean({
|
|
507
508
|
description: 'Emit the final one-shot response as JSON (use with --no-stream)',
|
|
508
509
|
}),
|
|
510
|
+
'idempotency-key': core_1.Flags.string({
|
|
511
|
+
description: 'Name this start (' + agent_chat_start_1.START_KEY_RULE + '). The CLI already names every start and, when ' +
|
|
512
|
+
'the server does not confirm one (a 502, 503 or 504, or a dropped connection), sends the ' +
|
|
513
|
+
'same request again so the server returns the turn it accepted instead of starting a ' +
|
|
514
|
+
'second one. Pass your own key to re-attach to a start from another process: the same ' +
|
|
515
|
+
'key and prompt return the original turn; a different prompt under it is refused.',
|
|
516
|
+
}),
|
|
509
517
|
'repair-wait': core_1.Flags.integer({
|
|
510
518
|
description: 'Seconds to keep waiting when a platform update restarts the server relaying a turn ' +
|
|
511
519
|
'your machine is still running. The server repairs the reply onto the conversation ' +
|
|
@@ -773,23 +781,43 @@ class AgentsChat extends base_command_1.BaseCommand {
|
|
|
773
781
|
? (0, local_skills_1.withSkillInvocations)(flags.prompt, localSkills.refs)
|
|
774
782
|
: flags.prompt;
|
|
775
783
|
(0, agent_home_workspace_1.commitAgentHomeWorkspaceDefault)(await homeWorkspace);
|
|
784
|
+
// Every start is named. A start whose answer is lost (the edge's 504, a restarting API,
|
|
785
|
+
// a dropped socket) is usually a turn the server DID accept; without a name the CLI
|
|
786
|
+
// could only report a failure and leave it running, holding balance, with its permission
|
|
787
|
+
// prompts unanswerable (OSK-22631). With one, the same request can be sent again and the
|
|
788
|
+
// server returns the original acceptance.
|
|
789
|
+
const suppliedStartKey = flags['idempotency-key'];
|
|
790
|
+
if (suppliedStartKey !== undefined && !(0, agent_chat_start_1.isValidStartKey)(suppliedStartKey)) {
|
|
791
|
+
this.error(`--idempotency-key must be ${agent_chat_start_1.START_KEY_RULE}.`, { exit: 2 });
|
|
792
|
+
}
|
|
793
|
+
const startKey = suppliedStartKey ?? (0, agent_chat_start_1.newStartKey)();
|
|
776
794
|
let started;
|
|
777
795
|
try {
|
|
778
|
-
started = await data_provider_1.dataService.startAgenticChat({
|
|
796
|
+
started = await (0, agent_chat_start_1.startWithReplay)(() => data_provider_1.dataService.startAgenticChat({
|
|
779
797
|
agentId: args.agentId,
|
|
780
798
|
taskId: boundTaskId,
|
|
781
799
|
text: contextParts ? `${contextParts}\n\n${prompt}` : prompt,
|
|
782
800
|
conversationId: threadConversationId,
|
|
783
801
|
workspaceId: process.env.OVERSKY_WORKSPACE_ID,
|
|
802
|
+
clientRequestId: startKey,
|
|
784
803
|
// The server resolves each ref against the session's daemon, so the
|
|
785
804
|
// turn is asked to run on the machine that listed them. An agent whose
|
|
786
805
|
// execution policy places it elsewhere keeps that placement, and the
|
|
787
806
|
// run fails saying why rather than running without the skill.
|
|
788
807
|
...daemonPinFields(localSkills, flags.daemon),
|
|
789
808
|
...permissionModeFields(flags['permission-mode']),
|
|
809
|
+
}), {
|
|
810
|
+
// stderr, so stdout and --json/--jsonl stay parseable.
|
|
811
|
+
onReplay: ({ attempt, of, waitMs }) => this.warn(`The server did not confirm the start; sending the same request again in ` +
|
|
812
|
+
`${Math.round(waitMs / 1000)}s (${attempt}/${of}). It returns the turn it ` +
|
|
813
|
+
`already accepted rather than starting a second one.`),
|
|
790
814
|
});
|
|
791
815
|
}
|
|
792
816
|
catch (err) {
|
|
817
|
+
if (err instanceof agent_chat_start_1.StartNotConfirmed) {
|
|
818
|
+
this.warn((0, agent_chat_start_1.startNotConfirmedHint)(startKey, err.attempts));
|
|
819
|
+
this.handleApiError(err.lastError);
|
|
820
|
+
}
|
|
793
821
|
// A refused start was the one API error on this command that escaped
|
|
794
822
|
// `handleApiError`: it fell through to the generic catch, which printed
|
|
795
823
|
// `HTTP 400 Bad Request — POST …/api/agentic/chat` under the code
|
|
@@ -18,6 +18,7 @@ const prompt_1 = require("../../lib/prompt");
|
|
|
18
18
|
const agent_config_1 = require("../../lib/agent-config");
|
|
19
19
|
const web_url_1 = require("../../lib/web-url");
|
|
20
20
|
const agent_spec_1 = require("../../lib/agent-spec");
|
|
21
|
+
const AGENT_CREATE_MISSING_FIELDS_MESSAGE_RE = /^--/;
|
|
21
22
|
/**
|
|
22
23
|
* OSK-4831 — build the missing-fields sentence from the real missing set.
|
|
23
24
|
*
|
|
@@ -35,7 +36,9 @@ const agent_spec_1 = require("../../lib/agent-spec");
|
|
|
35
36
|
*/
|
|
36
37
|
function agentCreateMissingFieldsMessage(missing) {
|
|
37
38
|
const plural = missing.length > 1;
|
|
38
|
-
const fields = missing
|
|
39
|
+
const fields = missing
|
|
40
|
+
.map((flag) => flag.replace(AGENT_CREATE_MISSING_FIELDS_MESSAGE_RE, ''))
|
|
41
|
+
.join('/');
|
|
39
42
|
return (`${missing.join(' and ')} ${plural ? 'are' : 'is'} required. ` +
|
|
40
43
|
`Pass ${plural ? 'them' : 'it'}, or include ${fields} in --from-json. ` +
|
|
41
44
|
'`skrr agents list --json` shows the provider and model of agents you already have, ' +
|
|
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
|
|
|
5
5
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
6
|
const base_command_1 = require("../../base-command");
|
|
7
7
|
const web_url_1 = require("../../lib/web-url");
|
|
8
|
+
const OPTIONAL_OVERVIEW_SECTION_RE = /\b403\b/;
|
|
8
9
|
function optionalOverviewSection(section, result) {
|
|
9
10
|
if (result.status === 'fulfilled')
|
|
10
11
|
return { value: result.value };
|
|
@@ -13,7 +14,7 @@ function optionalOverviewSection(section, result) {
|
|
|
13
14
|
// selected workspace. It is optional onboarding context, not an Agent
|
|
14
15
|
// readiness failure, so an owner inspecting a new Agent should see it as
|
|
15
16
|
// empty rather than an unexplained 403 that suggests partial creation.
|
|
16
|
-
if (section === 'notepad' &&
|
|
17
|
+
if (section === 'notepad' && OPTIONAL_OVERVIEW_SECTION_RE.test(message))
|
|
17
18
|
return { value: null };
|
|
18
19
|
return { value: null, warning: { section, message } };
|
|
19
20
|
}
|
|
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const core_1 = require("@oclif/core");
|
|
4
4
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
5
|
const base_command_1 = require("../../../base-command");
|
|
6
|
+
const BETA_WRITE_MAY_HAVE_COMMITTED_RE = /fetch failed|socket hang up|timed? ?out/i;
|
|
6
7
|
function betaWriteMayHaveCommitted(error) {
|
|
7
8
|
const failure = error;
|
|
8
9
|
const status = failure?.status ?? failure?.response?.status;
|
|
9
10
|
return status === 408 || (typeof status === 'number' && status >= 500) ||
|
|
10
11
|
['ECONNRESET', 'ETIMEDOUT', 'EAI_AGAIN', 'ENOTFOUND'].includes(failure?.code ?? '') ||
|
|
11
|
-
|
|
12
|
+
BETA_WRITE_MAY_HAVE_COMMITTED_RE.test(failure?.message ?? '');
|
|
12
13
|
}
|
|
13
14
|
class AgentsReleasesCreate extends base_command_1.BaseCommand {
|
|
14
15
|
static description = 'Create a private agent release';
|